* for Stata 10+log using WashConReplicate.log, replaceset mem 500mset more offinsheet using pwt62.csvreplace isocode = "DEU" if isocode == "GER"keep rgdpch isocode year gen ly = log(rgdpch)gen keeper = 0replace keeper = 1 if year ==1960replace keeper = 1 if year ==1965replace keeper = 1 if year ==1970replace keeper = 1 if year ==1975replace keeper = 1 if year ==1985replace keeper = 1 if year ==1980replace keeper = 1 if year ==1990replace keeper = 1 if year ==1995replace keeper = 1 if year ==2000drop if keeper == 0drop rgdpch keepersort isocode yearsave temp, replaceclear* get barro lee schoolinguse BLyears25.dtagen keeper = 0replace keeper = 1 if year ==1970replace keeper = 1 if year ==1975replace keeper = 1 if year ==1980replace keeper = 1 if year ==1985replace keeper = 1 if year ==1990replace keeper = 1 if year ==1995replace keeper = 1 if year ==1999keep if keeper == 1sort isocode yearmerge isocode year using temp.dta tab _mergedrop _mergesort isocode year* reshaperename tyr schoolkeep isocode year ly school reshape wide ly  school, i(isocode) j(year)sort isocodesave temp, replaceclear* get tariffsinsheet using TariffsEarlyLateRev2.txtrename yr yearsort isocode yearreplace year = 1 if year<1995replace year = 2 if year>1995reshape wide tcap tcon tint	tnes, i(isocode) j(year)sort isocodemerge isocode using temp.dta tab _mergedrop _mergesort isocodesave temp, replaceclearuse Edwards.dtagen str3 isocode = ccodedrop ccodelist var1 if isocode==""drop if isocode==""sort isocodemerge isocode using temp.dta tab _mergedrop _mergesort isocodemerge isocode using wdidata.dtatab _mergedrop _mergesave temp, replace* use wdi data for growthgen growth1 = (log(gdppc1990)-log(gdppc1975))/15gen growth2 = (log(gdppc2004)-log(gdppc1990))/14gen dgrowth = growth2 - growth1gen ltcon1 = log(1+tcon1/100)gen ltcon2 = log(1+tcon2/100)gen ltk1 = log(1+tcap1/100)gen ltk2 = log(1+tcap2/100)gen lti1 = log(1+tint1/100)gen lti2 = log(1+tint2/100)gen ltki1 = log(1+0.5*tcap1/100+0.5*tint1/100)gen ltki2 = log(1+0.5*tcap2/100+0.5*tint2/100)gen dltcon = ltcon2 - ltcon1gen dltc = ltcon2 - ltcon1gen dltk = ltk2 - ltk1gen dlti = lti2 - lti1gen dltki = ltki2 - ltki1*gen lz1 = ltcap1 - ltcon1*gen lz2 = ltcap2 - ltcon2*gen dlz = lz2 - lz1gen school1 = school1975gen school2 = school1990gen dschool = school2 - school1sort isocodesave temp, replace* get efw dataclear*use efw2001.dta*rename areav inst*rename viaidata tariffuse efwdata2005.dtarename area2ab instrename area4aiidata  tariffkeep year isocode inst tariffreshape wide inst tariff, i(isocode) j(year)gen inst1 = inst1985/10gen inst2 = inst2000/10gen dinst = inst2 - inst1gen tariff1 = tariff1985/100gen tariff2 = tariff2000/100gen dtariff = tariff2 - tariff1gen ltar1 = log(1+tariff1)gen ltar2 = log(1+tariff2)gen dltar = ltar2 - ltar1keep isocode inst1 inst2 dinst tariff1 tariff2 dtariff ltar1 ltar2 dltarsort isocodemerge isocode using temp.dtatab _mergedrop _mergesort isocodeerase temp.dta* define developinggen developing = 0replace developing = 1 if imfcode>=199replace developing = 1 if imfcode==186* define cap importersgen capimp = .* based on 1987 datareplace capimp=1 if isocode=="ARG"replace capimp=1 if isocode=="AUS"replace capimp=1 if isocode=="BLX"replace capimp=1 if isocode=="BOL"replace capimp=1 if isocode=="BRA"replace capimp=1 if isocode=="CAN"replace capimp=1 if isocode=="CHL"replace capimp=1 if isocode=="CHN"replace capimp=1 if isocode=="COL"replace capimp=0 if isocode=="DEU"replace capimp=1 if isocode=="DNK"replace capimp=1 if isocode=="ECU"replace capimp=1 if isocode=="ESP"replace capimp=1 if isocode=="FRA"replace capimp=0 if isocode=="GBR"replace capimp=1 if isocode=="HKG"replace capimp=1 if isocode=="IDN"replace capimp=1 if isocode=="IND"replace capimp=0 if isocode=="ITA"replace capimp=0 if isocode=="JPN"replace capimp=1 if isocode=="KOR"replace capimp=1 if isocode=="MEX"replace capimp=1 if isocode=="MYS"replace capimp=1 if isocode=="NLD"replace capimp=1 if isocode=="NZL"replace capimp=1 if isocode=="PAK"replace capimp=1 if isocode=="PER"replace capimp=1 if isocode=="PHL"replace capimp=1 if isocode=="PRY"replace capimp=1 if isocode=="SGP"replace capimp=0 if isocode=="SWE"replace capimp=1 if isocode=="THA"replace capimp=1 if isocode=="TUR"replace capimp=0 if isocode=="TWN"replace capimp=1 if isocode=="URY"replace capimp=1 if isocode=="USA"replace capimp=1 if isocode=="VEN"replace capimp=1 if isocode=="AUT"replace capimp=1 if isocode=="BGD"replace capimp=1 if isocode=="CIV"replace capimp=1 if isocode=="DZA"replace capimp=1 if isocode=="FIN"replace capimp=1 if isocode=="GHA"replace capimp=1 if isocode=="ISL"replace capimp=1 if isocode=="ISR"replace capimp=1 if isocode=="LKA"replace capimp=1 if isocode=="MAR"replace capimp=1 if isocode=="NPL"replace capimp=1 if isocode=="TTO"*nb 1987 data is na for *CIV	86*GHA	85*NPL	86* define notg7gen g7 = 0replace g7 = 1 if isocode=="USA"replace g7 = 1 if isocode=="GBR"replace g7 = 1 if isocode=="FRA"replace g7 = 1 if isocode=="ITA"replace g7 = 1 if isocode=="CAN"replace g7 = 1 if isocode=="DEU"replace g7 = 1 if isocode=="JPN"gen notg7 = 1 - g7* define libegen dltarmed1 = median(dltar)egen dltarmed2 = median(dltar) if developinggen lib1 = 0 if dltar~=.replace lib1 = 1 if dltar < dltarmed1 & dltar~=.replace lib1 = . if dltar==.gen lib2 = 0 if dltar~=.replace lib2 = 1 if dltar < dltarmed2 & dltar~=. & developingegen dltcmed = median(dltc)egen dltkmed = median(dltk)egen dltimed = median(dlti)egen dltkimed = median(dltki)gen libc = 0 if dltc~=.replace libc = 1 if dltc < dltcmed & dltc~=.replace libc = . if dltc==.gen libk = 0 if dltk~=.replace libk = 1 if dltk < dltkmed & dltk~=.replace libk = . if dltk==.gen libi = 0 if dlti~=.replace libi = 1 if dlti < dltimed & dlti~=.replace libi = . if dlti==.gen libki = 0 if dltki~=.replace libki = 1 if dltki < dltkimed & dltki~=.replace libki = . if dltki==.***************************************************************** start results******************************************************************* TABLE 1* discrete lib* avg tar reg dgrowth lib1 growth1 dschool dinsteststo* c tar reg dgrowth libc growth1 dschool dinsteststo* k tar reg dgrowth libk growth1 dschool dinsteststo* i tar reg dgrowth libi growth1 dschool dinsteststo* ki tar reg dgrowth libki growth1 dschool dinsteststoesttab using Table1a.csv,  r2 cells(b se) replace order(lib1 libc libk libi libki) drop(_cons)eststo clear* avg tar reg dgrowth lib1 growth1 eststo* c tar reg dgrowth libc growth1 eststo* k tar reg dgrowth libk growth1 eststo* i tar reg dgrowth libi growth1 eststo* ki tar reg dgrowth libki growth1 eststoesttab using Table1b.csv, r2 cells(b se)  replace order(lib1 libc libk libi libki) drop(_cons)eststo clear*** TABLE 2* NB wdi drops out / use pwt for 60-75 growth and placebo falsification testgen growth0p = (ly1975-ly1960)/15gen growth1p = (ly1990-ly1975)/15gen dgrowthp = growth1p - growth0p* placebo**** Falsification exercise with identical "placebo" treatment imposed at 1975 breakpoint* growth model, lag y only - OLS* avg tar reg dgrowthp lib1 growth0eststo* con reg dgrowthp libc growth0eststo* cap reg dgrowthp libk growth0eststo* int reg dgrowthp libi growth0eststo* cap int reg dgrowthp  libki growth0eststoesttab using Table2.csv, r2 cells(b se)  replace order(lib1 libc libk libi libki) drop(_cons)eststo clear*** TABLE 3*** TABLE 1* cts lib* avg tar reg dgrowth dltar growth1 dschool dinsteststo* c tar reg dgrowth dltc growth1 dschool dinsteststo* k tar reg dgrowth dltk growth1 dschool dinsteststo* i tar reg dgrowth dlti growth1 dschool dinsteststo* ki tar reg dgrowth dltki growth1 dschool dinsteststoesttab using Table3a.csv, r2 cells(b se)  replace order(dltar dltc dltk dlti dltki) drop(_cons)eststo clear* avg tar reg dgrowth dltar growth1 eststo* c tar reg dgrowth dltc growth1 eststo* k tar reg dgrowth dltk growth1 eststo* i tar reg dgrowth dlti growth1 eststo* ki tar reg dgrowth dltki growth1 eststoesttab using Table3b.csv, r2 cells(b se)  replace order(dltar dltc dltk dlti dltki) drop(_cons)eststo clear*** TABLE 4* ROBUST for K/I/KI* k tar reg dgrowth dltk growth1eststo* i tar reg dgrowth dlti growth1eststo* ki tar reg dgrowth dltki growth1eststo* k tar rreg dgrowth dltk growth1eststo* i tar rreg dgrowth dlti growth1eststo* ki tar rreg dgrowth dltki growth1eststoesttab using Table4.csv, r2 cells(b se)  replace order(dltk dlti dltki) drop(_cons)eststo clear*** TABLE 5* add other policiessort isocodemerge isocode using otherpolicies.dtadrop _mergereg dgrowth growth1 libki eststoreg dgrowth growth1 libki deklibeststoreg dgrowth growth1 libki dcklibeststoreg dgrowth growth1 libki dpcvoleststoreg dgrowth growth1 libki dxrvoleststoreg dgrowth growth1 libki dcgvoleststoreg dgrowth growth1 libki deklib dcklib dpcvol dxrvol dcgvoleststoesttab using Table5a.csv, r2 cells(b se)  replace order(libki growth1) drop(_cons)eststo clearreg dgrowth growth1 dltki eststoreg dgrowth growth1 dltki deklibeststoreg dgrowth growth1 dltki dcklibeststoreg dgrowth growth1 dltki dpcvoleststoreg dgrowth growth1 dltki dxrvoleststoreg dgrowth growth1 dltki dcgvoleststoreg dgrowth growth1 dltki deklib dcklib dpcvol dxrvol dcgvoleststoesttab using Table5b.csv, r2 cells(b se)  replace order(libki growth1) drop(_cons)eststo clear*** TABLE 6* endoegneity -- explaining levels/changes in tariffs* efw datasort isocodemerge isocode using ACLPFreedomHouse.dtagen pollib1 = (7-pollib1975)/6gen pollib2 = (7-pollib1990)/6gen dpollib = pollib2 - pollib1tab _mergedrop _mergereg ltar1 inst1eststoreg dltar inst1eststoreg dltar dinsteststoreg ltar1 pollib1eststoreg dltar pollib1eststoreg dltar dpollibeststoesttab using Table6a.csv, r2 cells(b se)  replace drop(_cons)eststo clearreg ltar1 inst1 if developingeststoreg dltar inst1 if developingeststoreg dltar dinst if developingeststoreg ltar1 pollib1 if developingeststoreg dltar pollib1 if developingeststoreg dltar dpollib if developingeststoesttab using Table6b.csv, r2 cells(b se)  replace drop(_cons)eststo clear*** TABLE 7*sort isocodemerge isocode using roseaccession.dtatab _mergedrop _mergesort isocodegen gattwait = accyear-1948replace gattwait = . if isocode=="TWN"gen gattyears = 54 - gattwaitgen gatt86 = 0replace gatt86 = 1 if accyear<1986gen gatt75 = 0replace gatt75 = 1 if accyear<1975gen gattwaitl = ln(gattwait)gen gatpot75 = gatt75*ltki1reg dltki gatpot75 growth1   if  dschool~=. & dinst~=. & dgrowth~=.eststoivreg dgrowth (dltki=gatpot75) growth1eststoreg dltki gatpot75 growth1 dschool dinst  if  dschool~=. & dinst~=. & dgrowth~=.eststoivreg dgrowth (dltki=gatpot75) growth1 dschool dinst eststoesttab using Table7a.csv, r2 cells(b se) order(gatpot75 dltki) replace drop(_cons)eststo cleardrop if isocode==""sort isocodemerge isocode using madd2004gtdep.dtatab _mergedrop _mergegen gatpotgd = gtdep*ltki1reg dltki gatpotgd growth1   if  dschool~=. & dinst~=. & dgrowth~=.eststoivreg dgrowth (dltki=gatpotgd) growth1eststoreg dltki gatpotgd growth1 dschool dinst  if  dschool~=. & dinst~=. & dgrowth~=.eststoivreg dgrowth (dltki=gatpotgd) growth1 dschool dinst eststoesttab using Table7b.csv, r2 cells(b se) order(gatpotgd dltki) replace drop(_cons)eststo clear*** Table 8 at the end of this file, need other definitions first*** FIGURE 2* define hi low and lib - avg tariffsgen tariffend = ltar2bysort isocode: egen tariffend1 = median(tariffend)egen tariffendm = median(tariffend)gen tariffendlow = 0 if tariffendm~=.replace tariffendlow = 1 if tariffend1<tariffendmgen liberalizer = exp(ltar2)-1 if lib1==1gen nonliberalizer = exp(ltar2)-1 if lib1==0gen nonlib_low = exp(ltar2)-1 if lib1==0 & tariffendlow==1gen nonlib_high = exp(ltar2)-1 if lib1==0 & tariffendlow==0gen tar1 = exp(ltar1)-1label var liberalizer "Liberalizers"label var nonliberalizer "Nonliberalizers"label var nonlib_high "Non-Liberalizers: High Tariffs"label var nonlib_low "Non-Liberalizers: Low Tariffs"label var tar1 "45 degree line"scatter liberalizer nonliberalizer tar1 tar1, ///	saving(Figure2a,replace) xtitle(ln (1+t) before) ytitle(ln (1+t) after) mlabel(isocode isocode) c(. . l) msymbol(o o i)gr export Figure2a.pdf, replacelist isocode tar1 liberalizer nonlib_high nonlib_low if tar1~=.drop tariffend tariffend* liberalizer nonliberalizer nonlib_low nonlib_high tar1* define hi low and lib - K tariffsgen tariffend = ltki2bysort isocode: egen tariffend1 = median(tariffend)egen tariffendm = median(tariffend)gen tariffendlow = 0 if tariffendm~=.replace tariffendlow = 1 if tariffend1<tariffendmgen liberalizer = exp(ltki2)-1 if libki==1gen nonliberalizer = exp(ltki2)-1 if libki==0gen nonlib_low = exp(ltki2)-1 if libki==0 & tariffendlow==1gen nonlib_high = exp(ltki2)-1 if libki==0 & tariffendlow==0gen tar1 = exp(ltki1)-1label var liberalizer "Liberalizers"label var nonliberalizer "Nonliberalizers"label var nonlib_high "Non-Liberalizers: High Tariffs"label var nonlib_low "Non-Liberalizers: Low Tariffs"label var tar1 "45 degree line"scatter liberalizer nonliberalizer tar1 tar1, ///	saving(Figure2b,replace) xtitle(ln (1+tki) before) ytitle(ln (1+tki) after) mlabel(isocode isocode) c(. . l) msymbol(o o i)gr export Figure2b.pdf, replace	list isocode tar1 liberalizer nonlib_high nonlib_low if tar1~=.*** FIGURE 4 (Fig 3 below)keep isocode liberalizer nonliberalizersort isocodesave treatments2, replaceclearinsheet using pwt62.csvreplace isocode = "DEU" if isocode == "GER"sort isocode yearmerge isocode using treatments2gen ly=ln(rgdpch)gen lyhold=ly if year==1975bysort isocode: egen ly75=mean(lyhold)gen lyrel = ly - ly75bysort year: egen lyn = mean(lyrel)  if nonliberalizer~=.bysort year: egen lyl = mean(lyrel)  if liberalizer~=.reg lyl year if year>=1975 & year<=1989predict lyltrendreg lyn year if year>=1975 & year<=1989predict lyntrendgen lyl0 = lyl-lyltrendgen lyn0 = lyn-lyntrendlabel var lyl0 "Liberalizers"label var lyn0 "Nonliberalizers"scatter lyl0 lyn0 year if year>=1960 & year<=2003, ///	saving(Figure4,replace) s(o +) c(l l) ytitle(Log income per worker relative to 1975-89 trend)gr export Figure4.pdf, replacelist country isocode if liberalizer~=. & year==1999list country isocode if nonliberalizer~=. & year==1999*** FIGURE 3* use efw dataclearuse efwdata2005.dtarename area2ab instrename area4aiidata  tariff* define developinggen developing = 0replace developing = 1 if ifscode>=199replace developing = 1 if ifscode==186bysort year: egen t0 = mean(tariff) if developing ~=.bysort year: egen t1 = mean(tariff) if developing==0 & developing ~=.bysort year: egen t2 = mean(tariff) if developing==1 & developing ~=.bysort year: sum tariff if developing ~=.bysort year: sum tariff if developing==0 & developing ~=.bysort year: sum tariff if developing==1 & developing ~=.rename t0 allrename t1 developedrename t2 LDCgraph twoway line all developed LDC year if year>1970, msymbol(x + O) saving(Figure3a,replace)gr export Figure3a.pdf, replacesort isocode yearlist isocode year all developed LDC if year>1970* define hi low and libgen tariffend = tariff if year==2000bysort isocode: egen tariffend1 = median(tariffend)egen tariffendm = median(tariffend)gen tariffendlow = 0 if tariffendm~=.replace tariffendlow = 1 if tariffend1<tariffendmbysort year: egen t3 = mean(tariff) if developing==1 & developing ~=. & tariffendlow==1bysort year: egen t4 = mean(tariff) if developing==1 & developing ~=. & tariffendlow==0gen lt85 = tariff if year==1985bysort isocode: egen lt85a = mean(lt85)gen lt00 = tariff if year==2000bysort isocode: egen lt00a = mean(lt00)gen dlt = lt00a-lt85aegen dltm = median(dlt)gen lib = 0 if dlt~=.replace lib = 1 if dlt<dltmbysort year: egen t5 = mean(tariff) if developing==1 & developing ~=. & tariffendlow==1 & lib==0bysort year: egen t6 = mean(tariff) if developing==1 & developing ~=. & tariffendlow==0 & lib==0bysort year: egen t7 = mean(tariff) if developing==1 & developing ~=. & lib==1bysort year: egen t8 = mean(tariff) if developing==1 & developing ~=. & lib==0rename t6 nonlib_highrename t5 nonlib_lowrename t7 liberalizerrename t8 nonliberalizerlabel var liberalizer "Liberalizers"label var nonlib_high "Non-Liberalizers: High Tariffs"label var nonlib_low "Non-Liberalizers: Low Tariffs"label var nonliberalizer "Non-Liberalizers"graph twoway line liberalizer nonliberalizer year if year>1970, msymbol(x + O) saving(Figure3b,replace)gr export Figure3b.pdf, replacesort isocode yearlist isocode year nonlib_high nonlib_low liberalizer if year>1970sort ifscode yearlist efwname isocode ifscode developing if tariffendlow==1 & lib==0 & year==2000list efwname isocode ifscode developing if tariffendlow==0 & lib==0 & year==2000list efwname isocode ifscode developing if lib==1 & year==2000*** TABLE 8clearuse CapImportsumrename reporter isocodekeep iso product y*sort isocodemerge isocode using treatments2drop if _merge==2reshape long y, i(isocode product) j(year) rename y importsrename isocode isosort iso yeargen post=0 if year<1990replace post=1 if year >=1990drop if year>=2005drop if year<1975egen isonum = group(iso)egen prodnum = group(product)gen panelnum = isonum*1000 + prodnumsort panelnum yearxtset panelnum year*preservegen limp = log(imports)gen dlimp = d.limpgen lib=.replace lib=1 if liberalizer~=.replace lib=0 if nonliberalizer~=.replace year=year-1990gen postyear=post*yeargen postlib = post*libgen yearlib = year*libgen postyearlib =  post*year*liblabel var post "Post-1990"label var year "Year"label var postyear "Post-1990 * Year"label var postlib "Liberalizer * Post-1990"label var yearlib "Liberalizer * Year"label var postyearlib "Liberalizer * Post-1990 * Year"eststo cleareststo: areg limp post year postyear postlib yearlib postyearlib ///	if product=="CapNew", cluster(iso) robust a(iso)eststo: areg limp post year postyear postlib yearlib postyearlib ///	if product=="IntNew", cluster(iso) robust a(iso)esttab using Table8.csv, ///	label page replace nocons r2 se star(* 0.10 ** 0.05 *** 0.01) ///	title("Difference-in-difference estimates for import growth rates") ///	mtitles("All capital goods" "All intermediate goods") ///	addnote("Fixed country effects not shown. Robust standard errors clustered by country.")eststo clearset more onlog close